﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Resources;
using System.Globalization;

namespace LPV_POS.mh_pos
{
    public partial class mh_banhang6_PhuThu : Form
    {
        //CultureInfo culture;

        #region "Muti language"

        private void SetLanguage_banhang(string cultureName)
        {
            //try
            //{
            //    culture = CultureInfo.CreateSpecificCulture(cultureName);
            //    ResourceManager rm = new ResourceManager("LPV_POS.Muti_language.MyResource", typeof(mh_banhang6_PhuThu).Assembly);
            //    lblVAT_Co.Text = rm.GetString("vat", culture);
            //    lblVAT_Khong.Text = rm.GetString("khongvat", culture);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.ToString(), "Note");
            //}

        }

        #endregion

        public mh_banhang6_PhuThu()
        {
            InitializeComponent();
            //culture = CultureInfo.CurrentCulture;
        }

        //private void lblVAT_Co_Click(object sender, EventArgs e)
        //{
        //    new cpublic().Registry_Set("BH_PhuThu.VAT", 1);
        //    this.DialogResult = DialogResult.OK;
        //    this.Close();
        //}

        //private void lblVAT_Khong_Click(object sender, EventArgs e)
        //{
        //    new cpublic().Registry_Set("BH_PhuThu.VAT", 0);
        //    this.DialogResult = DialogResult.Cancel;
        //    this.Close();
        //}

        private void mh_banhang6_PhuThu_Load(object sender, EventArgs e)
        {
            cpublic ocpublic = new cpublic();
            //string str_lang = ocpublic.Registry_Get("mh_main_lang");
            //if (str_lang == "")
            //    str_lang = "vi-VN";
            //SetLanguage_banhang(str_lang);
            //
            lblVAT_Co.Checked = ocpublic.Registry_Get("BH_PhuThu.VAT") == "True";
            lblPhiDichVu_Co.Checked = ocpublic.Registry_Get("BH_PhuThu.PHIDICHVU") == "True";
            lblTIP_Co.Checked = ocpublic.Registry_Get("BH_PhuThu.TIP") == "True";
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            cpublic ocpublic = new cpublic();
            ocpublic.Registry_Set("BH_PhuThu.VAT", lblVAT_Co.Checked);
            ocpublic.Registry_Set("BH_PhuThu.PHIDICHVU", lblPhiDichVu_Co.Checked);
            ocpublic.Registry_Set("BH_PhuThu.TIP", lblTIP_Co.Checked);
            this.Dispose();
        }

        private void lblVAT_Co_CheckedChanged(object sender, EventArgs e)
        {
            new cpublic().Registry_Set("BH_PhuThu.VAT", lblVAT_Co.Checked);
        }

        private void lblPhiDichVu_Co_CheckedChanged(object sender, EventArgs e)
        {
            new cpublic().Registry_Set("BH_PhuThu.PHIDICHVU", lblPhiDichVu_Co.Checked);
        }

        private void lblTIP_Co_CheckedChanged(object sender, EventArgs e)
        {
            new cpublic().Registry_Set("BH_PhuThu.TIP", lblTIP_Co.Checked);
        }
    }
}
